package bancosys.tec.persist.base.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.base.domain.VigenciaDummy;
import bancosys.tec.persist.dao.BeanNotFoundException;
import bancosys.tec.persist.exception.PersistenceException;
import bancosys.tec.persist.span.SpanAwareDAO;
import bancosys.tec.utils.date.Date;

/**
 * @created Feb 15, 2007
 * @author Gustavo Almeida
 */
public class VigenciaDummyDAO extends SpanAwareDAO<VigenciaDummy> {

    public VigenciaDummy findVigenciaDummyByDataInicio(Date date) throws PersistenceException, BeanNotFoundException {
        Criteria crit = this.getSession().createCriteria(this.getPersistableClass());
        crit.add(Restrictions.eq("dataInicio", date));
        return this.executeSingleQuery(crit);
    }
}
